﻿package view
{
    import com.sh.game.util.*;
    import flash.events.*;
    import morn.core.components.*;

    public class MyLabel extends Label
    {
        public var isOver:Boolean = false;
        private var _color:Object;

        public function MyLabel(param1:String = "", param2:String = null)
        {
            super(param1, param2);
            return;
        }// end function

        override protected function initialize() : void
        {
            super.initialize();
            this.stroke = "0x0";
            this.align = "left";
            this.color = MColor.New16;
            this.isHtml = true;
            addEventListener(MouseEvent.MOUSE_OVER, this.overHandler, false, 0, true);
            addEventListener(MouseEvent.MOUSE_OUT, this.outHandler, false, 0, true);
            addEventListener(MouseEvent.MOUSE_DOWN, this.outHandler, false, 0, true);
            addEventListener(MouseEvent.MOUSE_UP, this.overHandler, false, 0, true);
            return;
        }// end function

        protected function outHandler(event:MouseEvent) : void
        {
            if (this.isOver)
            {
                this.color = this._color;
            }
            return;
        }// end function

        override public function set color(param1:Object) : void
        {
            super.color = param1;
            if (param1 != MColor.New6)
            {
                this._color = param1;
            }
            return;
        }// end function

        protected function overHandler(event:MouseEvent) : void
        {
            if (this.isOver)
            {
                this.color = MColor.New6;
            }
            return;
        }// end function

    }
}
